<?php

declare(ENCODING = 'UTF-8');

/*                                                                        *
 * This script is part of the TYPO3 project - inspiring people to share!  *
 *                                                                        *
 * TYPO3 is free software; you can redistribute it and/or modify it under *
 * the terms of the GNU General Public License version 2 as published by  *
 * the Free Software Foundation.                                          *
 *                                                                        *
 * This script is distributed in the hope that it will be useful, but     *
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *	
 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
 * Public License for more details.                                       *
 *                                                                        */	

/**
 * @package auxo
 * @subpackage Web 
 * @version $Id$
 */

/**	
 * The Filter Interface
 * 
 * A filter is an object that performs filtering tasks on either the request, or on the response, 
 * or both. Filters perform filtering in the filter method. 
 *	
 * @package auxo
 * @subpackage Web
 * @version $Id$	
 * @copyright Copyright belongs to the respective authors
 * @author AHN
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
 */
interface tx_auxo_FilterInterface {
	/**
	 * Informs a filter about its initalization passes a configuration object
	 *
	 * @param tx_auxo_Configuration $configuration
	 */
	public function	initialize(tx_auxo_Configuration $configuration);
	
	/**
	 * The filter method of the Filter is called by the framework each time a request/response pair is passed 
	 * through the chain due to a client request for a resource at the end of the chain. The FilterChain passed 
	 * in to this method allows the Filter to pass on the request and response to the next entity in the chain.
	 * 
	 * A typical implementation of this method would follow the following pattern:
	 * 1. Examine the request
	 * 2. Optionally wrap the request object with a custom implementation to filter content or headers for input filtering
	 * 3. Optionally wrap the response object with a custom implementation to filter content or headers for output filterin
	 * 4. a) Either invoke the next entity in the chain using the FilterChain object (chain->sfilter()),
	 * 4. b) or not pass on the request/response pair to the next entity in the filter chain to block the request processing
	 * 5. Directly set headers on the response after invocation of the next entity in the filter chain. 
	 *
	 * @param tx_auxo_Request $request
	 * @param tx_auxo_Response $response
	 * @param tx_auxo_FilterChain $chain
	 */
	public function	filter(tx_auxo_Request $request, tx_auxo_Response $response, tx_auxo_FilterChain $chain);
}
?>